<template>
  <div>
    <h1 class="text-2xl lg:text-3xl font-bold my-4 lg:my-8 text-center">{{ solutionData.title }}</h1>
    <div v-html="solutionData.content"></div>
  </div>
</template>

<script setup>
const route = useRoute();
const { type, s_id } = route.params;
const apiUrl = {
  "application-case": `/api/solution/applicationDetails`,
  "customer-case": "/api/solution/customerDetails",
};
const { data: result } = await useAsyncData(`/detail/${s_id}`, async () => {
  const { data } = await useFetch(apiUrl[type], { params: { s_id: s_id } });
  return data.value;
});

const solutionData = ref({});
if (result.value.code === 1) {
  solutionData.value = result.value.data;
}
</script>
<style scoped lang="scss"></style>
